"use strict";
Object.defineProperty(exports, "__esModule", { value: true });
exports.middlewares = void 0;
const utils_1 = require("../utils/utils");
function middlewares(socket) {
    socket.use((event, next) => {
        socket.setInviteUser = (members) => {
            if (!socket.inviteUsers) {
                socket.inviteUsers = new Map;
            }
            if ((0, utils_1.isType)(members, 'array')) {
                members.forEach(member => {
                    socket.inviteUsers.set(member.userId, member);
                });
            }
            else {
                socket.inviteUsers.set(members.userId, members);
            }
        };
        next();
    });
}
exports.middlewares = middlewares;
